Skip to content

Add pharmapy-sim distribution, pixi environments, and install guide#136

Open
bernalde wants to merge 6 commits into
masterfrom
build/pixi-environment
Open

Add pharmapy-sim distribution, pixi environments, and install guide#136
bernalde wants to merge 6 commits into
masterfrom
build/pixi-environment

Conversation

@bernalde

@bernalde bernalde commented Jul 23, 2026

Copy link
Copy Markdown

Summary

Establish a safe pharmapy-sim distribution identity, add reproducible pixi
environments for development and Assimulo, and provide an authoritative
installation guide.

  • Rename the distribution from the occupied pharmapy namespace to
    pharmapy-sim while preserving import PharmaPy.
  • Keep [project] authoritative for pip builds and install the local project
    editably in pixi.
  • Add two locked environments:
    • default — core, Assimulo-free (matches -m "not assimulo")
    • assimulo — full solver backend (matches -m assimulo)
  • Provide pixi run test and pixi run -e assimulo test-assimulo.
  • Keep both the pip core job and the locked pixi install/import job gating;
    retain the potentially flaky Assimulo solver-test job as advisory.
  • Add an authoritative INSTALLATION.md covering pip, pixi, Assimulo, platform
    support, verification, and the manual conda fallback.
  • Link the guide from README, dependency policy, and published documentation;
    remove the obsolete setup.py develop installer scripts.

Installation model

pixi configuration stays under [tool.pixi]; it is a development and solver
environment manager, not a runtime dependency of the wheel. Core users install
from a checkout with:

python -m pip install .

After the first release, the distribution command will be:

python -m pip install pharmapy-sim

Do not run pip install pharmapy: that name belongs to an unrelated package.
The pharmapy-sim name was available when checked, but this PR does not reserve
it. Maintainers must recheck it immediately before the first release and must
not advertise the index-install command until publication succeeds.

Assimulo 3.4.3 is not available from PyPI. The supported solver path therefore
uses its conda-forge build through the locked pixi environment.

Verification (linux-64)

  • actionlint .github/workflows/ci.yml — passed.
  • pixi lock --check — lockfile is current.
  • pixi install --all --locked — both environments installed.
  • pixi run test56 passed, 4 skipped, 6 deselected.
  • pixi run -e assimulo test-assimulo14 passed, 56 deselected.
  • Both pixi environments import pharmapy-sim==0.0.1 from the working tree;
    the Assimulo environment imports Assimulo 3.4.3.
  • python -m build --sdist --wheel --no-isolation — built
    pharmapy_sim-0.0.1 sdist and wheel, with INSTALLATION.md in the sdist.
  • Fresh Python 3.11 venv: python -m pip install ., python -m pip check, and
    import PharmaPy all passed; the distribution metadata reports
    pharmapy-sim==0.0.1.
  • python -m docutils --strict doc/online_docs/installation.rst ... passed.
    The full Sphinx build cannot start on this branch because the existing docs
    environment does not install nbsphinx; PR Publish reproducible PharmaPy documentation #131 owns that reproducible docs
    environment and build.
  • Current-head GitHub Actions: Core tests, Locked pixi install, and Assimulo
    integration tests all passed. The locked-install job is gating; it installed
    both environments from pixi.lock, reran the documented install command,
    and verified core and solver imports. The solver-test job remains advisory.

Scope / follow-ups

  • Platforms: only linux-64 is locked and verified. Extending support
    requires adding a platform under [tool.pixi.workspace].platforms,
    regenerating the lockfile, and running both lanes there.
  • CI: the pip core and locked-pixi install/import jobs are gating. The
    Assimulo solver-test job retains continue-on-error: true to preserve the
    existing tolerance for compiled solver instability.
  • Conda fallback: environment.yml remains as an unlocked manual fallback.
  • PyPI reservation: publishing or reserving pharmapy-sim requires release
    authority and credentials and is intentionally not performed by this PR.
  • Docs overlap: PR Publish reproducible PharmaPy documentation #131 also touches README, pyproject.toml, and the
    installation page. Whichever PR lands second must preserve this installation
    guide and the pharmapy-sim distribution name while retaining Publish reproducible PharmaPy documentation #131's docs
    dependency and metadata updates.
  • This complements the lazy-import boundary in Make optional Assimulo imports lazy #135; no source modules are
    changed here.

Refs #134.

Introduce a `[tool.pixi]` configuration in pyproject.toml plus a committed
pixi.lock so the optional Assimulo backend can be obtained reproducibly.
Assimulo wraps the SUNDIALS C library via compiled Cython bindings and is
conda-forge only (not pip-installable), which previously forced an ad-hoc
conda environment.

- Two environments mirror the pytest.ini lanes: `default` (core, Assimulo-free)
  and `assimulo` (full backend). Tasks: `pixi run test`,
  `pixi run -e assimulo test-assimulo`.
- `[project]` remains the authoritative pip surface; pixi bounds mirror it.
- Only linux-64 is locked (the only verified platform); other platforms can be
  added to `[tool.pixi.workspace].platforms`.
- Ignore `.pixi/` and `.venv`/`.venv.*` so local env artifacts stay untracked.
- Document the pixi path in DEPENDENCIES.md.

Refs #134

@bernalde bernalde left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found two blocking installation/documentation issues in the inline comments.

Blocking issues: 2.
Nonblocking issues: none.
Questions: none.

Validation on head 145e0f2:

  • Local/GitHub changed-file sets match; the branch is based on the current master tip.
  • pixi lock --check passed, and pixi install --all --locked installed both locked environments.
  • pixi run test: 56 passed, 4 skipped for missing Assimulo as intended, 6 deselected.
  • pixi run -e assimulo test-assimulo: 14 passed, 56 deselected.
  • python -m build --sdist --wheel --no-isolation built both artifacts; a fresh Python 3.13 venv installed the wheel with pip and imported PharmaPy from site-packages successfully.
  • Current GitHub checks for this head are successful: Core tests and Assimulo integration tests. Local pytest runs emitted existing deprecation/runtime warnings.

The build evidence shows that the [tool.pixi] configuration itself does not obstruct setuptools or pip. The blockers are the occupied PyPI distribution namespace and the absence of a safe, authoritative installation guide. This account authored the PR, so GitHub does not allow it to submit a formal REQUEST_CHANGES verdict; this COMMENT carries the blocking findings.

Merge readiness: not ready. I would not merge this until the blocking issues above are addressed.

Comment thread pyproject.toml Outdated
Comment thread DEPENDENCIES.md
@bernalde bernalde changed the title Add pixi environments for reproducible conda-forge dev/CI (incl. Assimulo) Add reproducible pixi environments and installation guide Jul 23, 2026
@bernalde

Copy link
Copy Markdown
Author

Addressed both blocking review findings in 232cbb9.

  • Selected pharmapy-sim as the planned PyPI distribution name and updated both [project].name and the pixi editable-dependency key. The Python import remains PharmaPy.
  • Added INSTALLATION.md as the authoritative guide for source/pip and pixi installation, including the two test lanes, Assimulo, and the current linux-64 scope.
  • Linked the guide from the README, dependency policy, and published installation page, and removed the obsolete setup.py develop installers.
  • Kept pixi under [tool.pixi]; it is a development/Assimulo environment manager, not a wheel runtime dependency.

Verification:

  • Fresh Python 3.11 venv: python -m pip install ., python -m pip check, and import PharmaPy passed; installed metadata reports pharmapy-sim==0.0.1.
  • Built the pharmapy_sim-0.0.1 wheel and sdist; the sdist includes the installation guide.
  • pixi install --all --locked passed.
  • Core lane: 56 passed, 4 skipped, 6 deselected.
  • Assimulo lane: 14 passed, 56 deselected.
  • Both GitHub Actions jobs passed on the pushed commit.

No requested finding was declined. The full Sphinx build still depends on the nbsphinx environment work in PR #131; the updated installation page itself passes strict docutils validation. I have left the review threads unresolved for the reviewer to verify.

@bernalde bernalde left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maintainer review at the current head cc50392. Since my pixi commit (145e0f2), this branch advanced with two more commits — 232cbb9 (pip distribution + install guide) and cc50392 (clarify install paths) — so the PR now covers three things: the pixi environments, a PyPI distribution rename PharmaPypharmapy-sim, and an installation-guide overhaul. I authored this PR, so this is a COMMENT (GitHub rejects author APPROVE/REQUEST_CHANGES). No blocking findings at this head.

Prior blocking issues are resolved (verified independently)

The earlier review at 145e0f2 raised two Blocking issues; both are genuinely fixed here, and I re-verified rather than trusting the reply:

  • pip install PharmaPy grabbed an unrelated project. Confirmed https://pypi.org/pypi/pharmapy/json → HTTP 200 (taken, unrelated NER package). The fix renames [project].name and the pixi editable key to pharmapy-sim, preserving import PharmaPy. Confirmed pharmapy-sim and pharmapy_sim → HTTP 404 (both free, so PyPI-normalized name is genuinely available). INSTALLATION.md and installation.rst explicitly warn against pip install pharmapy.
  • No runnable install guide. INSTALLATION.md is now authoritative (install matrix, venv/pip source install, pixi prerequisite + --locked commands, Assimulo, linux-64 limitation, verification), linked from README, DEPENDENCIES.md, and installation.rst; the legacy install_instructions.txt, InstallOnMac.sh, InstallOnWindows.bat are removed with no dangling references (grep-confirmed), and MANIFEST.in updated.

Verified this pass (linux-64)

  • pixi install --all --locked at cc50392 succeeds — the committed pixi.lock matches the manifest after the rename (lock editable entry is pharmapy-sim), so the advertised command works.
  • pixi run -e assimulo python -c "import PharmaPy, assimulo" → import OK, Assimulo 3.4.3.
  • Core lane pixi run test → 56 passed, 4 skipped, 6 deselected.
  • RST link target .. _PharmaPy installation guide: is defined (no undefined-reference error for a -W docs build); README link uses the correct PharmaPy-org/.../blob/master URL.
  • PR-head CI: Core tests SUCCESS, Assimulo integration tests SUCCESS.

Nonblocking

  • PR title/body are stale. They describe only the pixi environments, but the PR now also renames the PyPI distribution to pharmapy-sim and overhauls installation docs. Update the title/body before merge so the scope — especially the public-identity rename — is visible to reviewers and in the merge commit.
  • pixi is not exercised by CI. Nothing runs pixi install --locked, so the committed lock can silently drift from the manifest (a future manifest edit without a re-lock would break the advertised --locked command). INSTALLATION.md is honest about this. Recommend a follow-up CI lane (a pixi install --all --locked smoke job) and a tracking issue, while keeping a pip-only core job.
  • Consider reserving pharmapy-sim on PyPI. It is free today, but nothing prevents a third party from registering it before the first release, which would reproduce exactly the collision this PR fixes. A placeholder release (or an explicit accepted-risk note) would close that gap.

Scope note

The PR bundles pixi + the distribution rename + the install-guide overhaul. These are causally linked (advertising pip install via pixi surfaced the namespace collision), so bundling is defensible, but if smaller PRs are preferred the rename+guide could be split from the pixi mechanism. Given they are intertwined and green, I did not treat this as blocking.

Merge-readiness

No blocking findings. Live state: state=OPEN, mergeStateStatus=CLEAN, reviewDecision empty; both PR-head CI checks SUCCESS. This is a body-only review (no inline threads), so it does not change mergeStateStatus. This author account cannot supply a formal APPROVE — GitHub currently reports no approval gate; if branch protection requires one, another eligible maintainer must approve. Recommend refreshing the PR title/body (scope) before merge.

Note: a prior review on this PR (145e0f2) is also under this account, from concurrent work on the same branch; GitHub takes the most recent review per reviewer, so this supersedes it for reviewDecision purposes.

@bernalde bernalde changed the title Add reproducible pixi environments and installation guide Add pharmapy-sim distribution, pixi environments, and install guide Jul 23, 2026
@bernalde

Copy link
Copy Markdown
Author

Addressed the current-head review follow-ups in a37e50e and the PR metadata.

  • Stale PR metadata: updated the title and body so the pharmapy-sim distribution rename, installation guide, and pixi environments are all explicit.
  • Pixi not exercised by CI: retained the independent pip-only core job and moved the Assimulo integration job to pinned setup-pixi. It installs both environments from pixi.lock, reruns pixi install --all --locked, verifies PharmaPy/Assimulo imports, and runs the solver test task.
  • Unreserved PyPI name: documented that pharmapy-sim remains unreserved until the first authorized release, must be rechecked before publication, and must not be advertised as an index install until upload succeeds.

Verification:

  • actionlint .github/workflows/ci.yml passed.
  • pixi lock --check and pixi install --all --locked passed.
  • Core pixi lane: 56 passed, 4 skipped, 6 deselected.
  • Assimulo pixi lane: 14 passed, 56 deselected; PharmaPy 0.0.1 and Assimulo 3.4.3 imported from the intended environment.
  • Current-head GitHub Actions passed both the pip core job and the locked-pixi Assimulo job.

No Blocking finding was declined. I intentionally did not publish a placeholder PyPI release: reserving or publishing pharmapy-sim requires separate release authority and credentials. The availability risk is now explicit in both INSTALLATION.md and the PR body.

The two earlier blocking threads remain unresolved for reviewer verification. GitHub reports an empty reviewDecision; this author account cannot provide a formal approval.

@bernalde bernalde left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Close-out review at head a37e50e, focused on the new CI commit a37e50e ("ci: verify locked pixi environments") that landed after my previous review at cc50392. Earlier commits (145e0f2, 232cbb9, cc50392) were reviewed already; all prior findings are resolved (see below). I authored this PR, so this is a COMMENT — GitHub rejects author APPROVE/REQUEST_CHANGES. No blocking findings.

The new CI commit (a37e50e) — verified

a37e50e replaces the ad-hoc conda setup of the integration-assimulo job with a pixi-based lane:

  • prefix-dev/setup-pixi@v0.10.0 — tag exists (confirmed via the GitHub API), pixi-version: v0.67.1, locked: true, manifest-path: pyproject.toml, both environments.
  • Steps: pixi install --all --locked (re-runs the documented command), import PharmaPy, assimulo, then pixi run -e assimulo test-assimulo.
  • The core-tests job stays pip-based and gating, preserving the pip-installability guarantee.
  • Workflow permissions: contents: read (least privilege); cache-write is correctly gated to push on master (no PR-branch cache poisoning).
  • Actual run 30050280722 at this head: every step of both jobs concluded success — including "Verify documented locked installation", "Verify solver imports", and "Run Assimulo-marked tests" — so the green result is real, not a swallowed failure.

Prior findings — all addressed

  • Prior Blocking (pyproject.toml): pip install PharmaPy grabbed an unrelated package → renamed to pharmapy-sim, re-confirmed at this head.
  • Prior Blocking (DEPENDENCIES.md): no runnable install guide → INSTALLATION.md authoritative and linked.
  • My stale-pr-metadata → title/body now describe the rename, pixi, and install guide.
  • My pixi-not-in-ci → this commit adds exactly that lane.
  • My reserve-pypi-name → documented guard added (recheck before release; do not advertise the index install until upload).

I am resolving the two prior Blocking inline threads for hygiene, since both are addressed at this head.

Nonblocking

  • Assimulo CI lane is non-gating vs the "verifies" claim. See inline.

Merge-readiness

No blocking findings; the current head genuinely passes both CI jobs (verified at the step level). Live state before this review: state=OPEN, mergeStateStatus=CLEAN, reviewDecision empty — no approval gate is enforced. This author account cannot supply a formal APPROVE; if branch protection later requires one, another eligible maintainer must approve. This review adds one Nonblocking inline thread; since conversation resolution is not enforced (CLEAN), it does not gate merge. Remaining non-code follow-ups are already tracked in the PR body (linux-64-only lock, PyPI name reservation at release, #131 docs overlap).

Comment thread INSTALLATION.md Outdated

- The core job installs PharmaPy editably with pip and runs the solver-free
tests.
- The Assimulo job installs both pixi environments from the committed lockfile,

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nonblocking: this presents the Assimulo job as a verification guarantee ("installs both pixi environments ... reruns the documented pixi install --all --locked command, verifies ..."), but that job carries continue-on-error: true (ci.yml, job declaration ~line 49), so any failure is non-gating — a broken lockfile or failed solver import would still report the check green. The non-blocking Assimulo lane is a reasonable, pre-existing strategy (assimulo/SUNDIALS is flaky), and it is not introduced by this PR, but a37e50e now leans on it as the lock-verification mechanism. Consider either (a) splitting the deterministic pixi install --all --locked lock-consistency check into a gating step/job (it is not flaky the way solver runs are), or (b) softening this paragraph to say the Assimulo lane is advisory/non-blocking. Not a merge blocker.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in a8517cc using option (a). Locked pixi install is now a separate gating job with no continue-on-error; it installs both locked environments, reruns the documented command, and verifies core and solver imports. The Assimulo solver-test job remains explicitly advisory and depends on that gating job. The guide and PR body now state this boundary, and all three current-head jobs passed.

@bernalde

Copy link
Copy Markdown
Author

Addressed the remaining nonblocking CI-semantics finding in a8517cc.

  • Split lockfile verification into a dedicated, gating Locked pixi install job.
  • The gating job installs both environments from pixi.lock, reruns pixi install --all --locked, and verifies both core and Assimulo imports.
  • Kept only the potentially flaky solver-test job advisory with continue-on-error: true; it depends on the gating lock job.
  • Updated INSTALLATION.md and the PR body to distinguish the gating installation guarantee from advisory solver-test health.

Verification:

  • actionlint .github/workflows/ci.yml passed.
  • pixi lock --check and pixi install --all --locked passed.
  • Core pixi lane: 56 passed, 4 skipped, 6 deselected.
  • Assimulo pixi lane: 14 passed, 56 deselected; PharmaPy 0.0.1 and Assimulo 3.4.3 imported from the intended environment.
  • Current-head GitHub Actions passed all three jobs: Core tests, Locked pixi install, and Assimulo integration tests. Every install/import step in the gating job passed.

No finding was declined. The two prior blocking threads are now resolved by the reviewer; the new CI-semantics thread remains unresolved for reviewer verification. GitHub reports an empty reviewDecision; this author account cannot provide a formal approval.

@bernalde
bernalde requested review from Mazhar331 and andres9403 July 24, 2026 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant